<script src="<?php echo base_url()?>/public/assets/js/laydate/laydate.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo base_url()?>/public/assets/css/jquery-ui.css" />
<div class="row">
	<div class="col-sm-12">
	    <div>
    		<a href="/admin/member?per_page=<?php if(!empty($_REQUEST['per_page']))echo $_REQUEST['per_page']?>" class="btn btn-info_01 float_right btn_search">返回</a>
    	</div>
		<div class="space"></div>
        <form action="/admin/member/update" method="post" onsubmit=" return yanzheng()">
		<input type="hidden" value="update" name="form_submit" />
		<input type="hidden" value="<?php echo $member_info['id']?>" name="id" />
		<table width="100%" class="table table-striped table-bordered table-hover" widtd="100%">
			<tr>
			  <td height="30" widtd="15%">所在园所：</td>
			  <td height="30" align="left" widtd="85%">
			  <select name="nursery_id">
			  	<?php foreach ($nursery_list as $val){?>
			  	<option value="<?php echo $val['id']?>"><?php echo $val['title']?></option>
			  	<?php }?>
			  </select>
			  </td>
		  </tr>
			<tr>
			    <td width="15%" height="30" widtd="15%">登录手机号：</td>
				<td width="85%" height="30" align="left" widtd="85%"><input type="text" value="<?php echo $member_info['login_mobile'];?>" name="login_mobile" disabled="disabled"/></td>
			</tr>
			<tr>
              <td height="30">微信用户昵称：</td>
			  <td height="30" align="left"><input type="text" value="<?php echo $member_info['wx_nick_name'];?>" name="wx_nick_name" disabled="disabled"/></td>
		  </tr>
			
			<tr>
			  <td height="30">微信用户头像：</td>
			  <td height="30" align="left"><img src="<?php echo $member_info['wx_avatar']?>" width='100px' /></td>
		  </tr>
			<tr>
			  <td height="30">宝宝姓名：</td>
			  <td height="30" align="left"><input type="text" value="<?php echo $member_info['baby_name'];?>" name="baby_name" /></td>
		  </tr>
			<tr>
			  <td height="30">宝宝性别：</td>
			  <td height="30" align="left">
			  <select name="baby_sex">
			  	<option value="1" <?php if($member_info['baby_sex'] == 1)echo 'selected="selected"'?>>男</option>
			  	<option value="0" <?php if($member_info['baby_sex'] == 0)echo 'selected="selected"'?>>女</option>
			  </select>			  </td>
		  </tr>
			<tr>
			  <td height="30">宝宝生日：</td>
			  <td height="30" align="left">
			  <input type="text" value="<?php echo $member_info['baby_birthday']?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" name="baby_birthday" class="txt" />			  </td>
		  </tr>
			<tr>
			  <td height="30">联系人：</td>
			  <td height="30" align="left"><input type="text" value="<?php echo $member_info['linkman'];?>" name="linkman"/></td>
		  </tr>
			<tr>
			  <td height="30">联系人手机号：</td>
			  <td height="30" align="left"><input type="text" value="<?php echo $member_info['link_mobile'];?>" name="link_mobile"/></td>
		  </tr>
			<tr>
			  <td height="30">宝宝上课地址：</td>
			  <td height="30" align="left">
			  <textarea name="address" style="width:400px"><?php echo $member_info['address'];?></textarea>			  </td>
		  </tr>
			<tr>
			  <td height="30">宝宝上课园所地址ID：</td>
			  <td height="30" align="left"><input type="text" value="<?php echo $member_info['nursery_id'];?>" name="nursery_id" disabled="disabled"/></td>
		  </tr>
			<tr>
			  <td height="30">用户状态：</td>
			  <td height="30" align="left">
			  <select name="status">
			  	<option value="1" <?php if($member_info['status'] == 1)echo 'selected="selected"'?>>正常</option>
			  	<option value="0" <?php if($member_info['status'] == 0)echo 'selected="selected"'?>>删除</option>
			  </select></td>
		  </tr>
			<tr>
			  <td height="30" colspan="2"><div align="center"><input type="submit" value="提交" /></div></td>
		  </tr>
	  </table>
	  </form>
	</div>
</div>
<script>
$("[name='nursery_id']").val(<?php echo $member_info['nursery_id']?>);
function yanzheng(){ 
	if(!$("[name='baby_name']").val()){ 
	    alert('请输入宝宝姓名！'); 
	    return false; 
	}
	if(!$("[name='linkman']").val()){ 
	    alert('请输入联系人！'); 
	    return false; 
	}
	var myreg = /^(((1[1-9]{1}))+\d{9})$/; 
	if(!myreg.test($("[name='link_mobile']").val())){ 
	    alert('请输入有效的手机号码！'); 
	    return false; 
	}
	if(!$("[name='address']").val()){ 
	    alert('请输入地址！'); 
	    return false; 
	}
	if(!confirm('确定要修改吗？')){
		return false;
	}
}
</script>
<!--content-->